﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Skyper.Controls {
	public class ContactControl : Control {
		#region Fields
		public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(String), typeof(ContactControl), GetDefaultTitle());
		public static readonly DependencyProperty MoodProperty = DependencyProperty.Register("Mood", typeof(String), typeof(ContactControl), GetDefaultMood());
		public static readonly DependencyProperty PhoneProperty = DependencyProperty.Register("Phone", typeof(String), typeof(ContactControl), GetDefaultPhone());
		public static readonly DependencyProperty AvatarProperty = DependencyProperty.Register("Avatar", typeof(ImageSource), typeof(ContactControl), GetDefaultAvatar());
		#endregion
		#region Constructor
		public ContactControl() {
			this.DefaultStyleKey = typeof(ContactControl);
		}
		#endregion
		#region Private
		private static PropertyMetadata GetDefaultTitle() {
			return new PropertyMetadata("Hello World",OnTitleChanged);
		}
		private static PropertyMetadata GetDefaultMood() {
			return new PropertyMetadata("Hello World",OnEmailChanged);
		}
		private static PropertyMetadata GetDefaultPhone() {
			return new PropertyMetadata("(181) 555-1337", OnPhoneChanged);
		}
		private static PropertyMetadata GetDefaultAvatar() {
			return new PropertyMetadata(null, OnAvatarChanged);
		}

		private static void OnTitleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
			
		}
		private static void OnEmailChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {

		}
		private static void OnPhoneChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {

		}
		private static void OnAvatarChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {

		}
		#endregion
		#region Property
		public String Title {
			get { return this.GetValue(TitleProperty) as String; }
			set { this.SetValue(TitleProperty, value); }
		}
		public String Mood {
			get { return this.GetValue(MoodProperty) as String; }
			set { this.SetValue(MoodProperty, value); }
		}
		public String Phone {
			get { return this.GetValue(PhoneProperty) as String; }
			set { this.SetValue(PhoneProperty, value); }
		}
		public String Avatar {
			get { return this.GetValue(AvatarProperty) as String; }
			set { this.SetValue(AvatarProperty, value); }
		}
		#endregion
	}
}
